<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen 2.8.0" />

	<title>Class CI_Zip | tis</title>

	<script type="text/javascript" src="resources/combined.js?1735077957"></script>
	<script type="text/javascript" src="elementlist.js?2977522689"></script>
	<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" />

</head>

<body>
<div id="left">
	<div id="menu">
		<a href="index.html" title="Overview"><span>Overview</span></a>


		<div id="groups">
			<h3>Packages</h3>
			<ul>
				<li class="active"><a href="package-CodeIgniter.html">CodeIgniter<span></span></a>
						<ul>
				<li><a href="package-CodeIgniter.Controllers.html">Controllers</a>
						</li>
				<li><a href="package-CodeIgniter.Drivers.html">Drivers</a>
						</li>
				<li class="active"><a href="package-CodeIgniter.Libraries.html">Libraries</a>
						</li>
				<li><a href="package-CodeIgniter.Models.html">Models</a>
						</li>
							</ul></li>
				<li><a href="package-None.html">None</a>
						</li>
			</ul>
		</div>

		<hr />


		<div id="elements">
			<h3>Classes</h3>
			<ul>
				<li><a href="class-Authhelper.html">Authhelper</a></li>
				<li><a href="class-CI_Benchmark.html">CI_Benchmark</a></li>
				<li><a href="class-CI_Cache.html">CI_Cache</a></li>
				<li><a href="class-CI_Cache_apc.html">CI_Cache_apc</a></li>
				<li><a href="class-CI_Cache_dummy.html">CI_Cache_dummy</a></li>
				<li><a href="class-CI_Cache_file.html">CI_Cache_file</a></li>
				<li><a href="class-CI_Cache_memcached.html">CI_Cache_memcached</a></li>
				<li><a href="class-CI_Calendar.html">CI_Calendar</a></li>
				<li><a href="class-CI_Cart.html">CI_Cart</a></li>
				<li><a href="class-CI_Config.html">CI_Config</a></li>
				<li><a href="class-CI_Controller.html">CI_Controller</a></li>
				<li><a href="class-CI_Driver.html">CI_Driver</a></li>
				<li><a href="class-CI_Driver_Library.html">CI_Driver_Library</a></li>
				<li><a href="class-CI_Email.html">CI_Email</a></li>
				<li><a href="class-CI_Encrypt.html">CI_Encrypt</a></li>
				<li><a href="class-CI_Exceptions.html">CI_Exceptions</a></li>
				<li><a href="class-CI_Form_validation.html">CI_Form_validation</a></li>
				<li><a href="class-CI_FTP.html">CI_FTP</a></li>
				<li><a href="class-CI_Hooks.html">CI_Hooks</a></li>
				<li><a href="class-CI_Image_lib.html">CI_Image_lib</a></li>
				<li><a href="class-CI_Input.html">CI_Input</a></li>
				<li><a href="class-CI_Javascript.html">CI_Javascript</a></li>
				<li><a href="class-CI_Jquery.html">CI_Jquery</a></li>
				<li><a href="class-CI_Lang.html">CI_Lang</a></li>
				<li><a href="class-CI_Loader.html">CI_Loader</a></li>
				<li><a href="class-CI_Log.html">CI_Log</a></li>
				<li><a href="class-CI_Migration.html">CI_Migration</a></li>
				<li><a href="class-CI_Model.html">CI_Model</a></li>
				<li><a href="class-CI_Output.html">CI_Output</a></li>
				<li><a href="class-CI_Pagination.html">CI_Pagination</a></li>
				<li><a href="class-CI_Parser.html">CI_Parser</a></li>
				<li><a href="class-CI_Profiler.html">CI_Profiler</a></li>
				<li><a href="class-CI_Router.html">CI_Router</a></li>
				<li><a href="class-CI_Security.html">CI_Security</a></li>
				<li><a href="class-CI_Session.html">CI_Session</a></li>
				<li><a href="class-CI_SHA1.html">CI_SHA1</a></li>
				<li><a href="class-CI_Table.html">CI_Table</a></li>
				<li><a href="class-CI_Trackback.html">CI_Trackback</a></li>
				<li><a href="class-CI_Unit_test.html">CI_Unit_test</a></li>
				<li><a href="class-CI_Upload.html">CI_Upload</a></li>
				<li><a href="class-CI_URI.html">CI_URI</a></li>
				<li><a href="class-CI_User_agent.html">CI_User_agent</a></li>
				<li><a href="class-CI_Utf8.html">CI_Utf8</a></li>
				<li><a href="class-CI_Xmlrpc.html">CI_Xmlrpc</a></li>
				<li><a href="class-CI_Xmlrpcs.html">CI_Xmlrpcs</a></li>
				<li class="active"><a href="class-CI_Zip.html">CI_Zip</a></li>
				<li><a href="class-MY_Controller.html">MY_Controller</a></li>
				<li><a href="class-Welcome.html">Welcome</a></li>
			</ul>





		</div>
	</div>
</div>

<div id="splitter"></div>

<div id="right">
<div id="rightInner">
	<form id="search">
		<input type="hidden" name="cx" value="" />
		<input type="hidden" name="ie" value="UTF-8" />
		<input type="text" name="q" class="text" />
		<input type="submit" value="Search" />
	</form>

	<div id="navigation">
		<ul>
			<li>
				<a href="index.html" title="Overview"><span>Overview</span></a>
			</li>
			<li>
				<a href="package-CodeIgniter.Libraries.html" title="Summary of CodeIgniter\Libraries"><span>Package</span></a>
			</li>
			<li class="active">
<span>Class</span>			</li>
		</ul>
		<ul>
			<li>
				<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
			</li>
		</ul>
		<ul>
		</ul>
	</div>

<div id="content" class="class">
	<h1>Class CI_Zip</h1>


	<div class="description">
	
<p>Zip Compression Class</p>

<p>This class is based on a library I found at Zend: <a
href="http://www.zend.com/codex.php?id=696&amp;single=1">http://www.zend.com/codex.php?id=696&single=1</a></p>

<p>The original library is a little rough around the edges so I refactored it
and added several additional methods -- Rick Ellis</p>

	</div>









	<div class="info">
		
		
		
		<b>Package:</b> <a href="package-CodeIgniter.html">CodeIgniter</a>\<a href="package-CodeIgniter.Libraries.html">Libraries</a><br />

				<b>Category:</b>
				Encryption<br />
				<b>Author:</b>
				ExpressionEngine Dev Team<br />
				<b>Link:</b>
				<a href="http://codeigniter.com/user_guide/libraries/zip.html">http://codeigniter.com/user_guide/libraries/zip.html</a><br />
		<b>Located at</b> <a href="source-class-CI_Zip.html#18-420" title="Go to source code">system/libraries/Zip.php</a><br />
	</div>



	<table class="summary" id="methods">
	<caption>Methods summary</caption>
	<tr data-order="__construct" id="___construct">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#___construct">#</a>
		<code><a href="source-class-CI_Zip.html#42-50" title="Go to source code">__construct</a>( )</code>

		<div class="description short">
			
<p>Constructor</p>

		</div>

		<div class="description detailed hidden">
			
<p>Constructor</p>








		</div>
		</div></td>
	</tr>
	<tr data-order="add_dir" id="_add_dir">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_add_dir">#</a>
		<code><a href="source-class-CI_Zip.html#54-76" title="Go to source code">add_dir</a>( <span>mixed <var>$directory</var></span> )</code>

		<div class="description short">
			
<p>Add Directory</p>

		</div>

		<div class="description detailed hidden">
			
<p>Add Directory</p>

<p>Lets you add a virtual directory into which you can place files.</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$directory</var></dt>
					<dd><code>mixed</code><br>the directory name. Can be string or array</dd>
				</dl></div>





		</div>
		</div></td>
	</tr>
	<tr data-order="_get_mod_time" id="__get_mod_time">

		<td class="attributes"><code>
			 public 
			array
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#__get_mod_time">#</a>
		<code><a href="source-class-CI_Zip.html#80-97" title="Go to source code">_get_mod_time</a>( <span>string <var>$dir</var></span> )</code>

		<div class="description short">
			
<p>Get file/directory modification time</p>

		</div>

		<div class="description detailed hidden">
			
<p>Get file/directory modification time</p>

<p>If this is a newly created file/dir, we will set the time to 'now'</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$dir</var></dt>
					<dd><code>string</code><br>path to file</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>array</code><br>filemtime/filemdate<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="_add_dir" id="__add_dir">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#__add_dir">#</a>
		<code><a href="source-class-CI_Zip.html#101-145" title="Go to source code">_add_dir</a>( <span>string <var>$dir</var></span>, <span>mixed <var>$file_mtime</var></span>, <span>mixed <var>$file_mdate</var></span> )</code>

		<div class="description short">
			
<p>Add Directory</p>

		</div>

		<div class="description detailed hidden">
			
<p>Add Directory</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$dir</var></dt>
					<dd><code>string</code><br>the directory name</dd>
					<dt><var>$file_mtime</var></dt>
					<dd></dd>
					<dt><var>$file_mdate</var></dt>
					<dd></dd>
				</dl></div>





		</div>
		</div></td>
	</tr>
	<tr data-order="add_data" id="_add_data">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_add_data">#</a>
		<code><a href="source-class-CI_Zip.html#149-178" title="Go to source code">add_data</a>( <span>mixed <var>$filepath</var></span>, <span>string <var>$data</var> = <span class="php-keyword1">NULL</span></span> )</code>

		<div class="description short">
			
<p>Add Data to Zip</p>

		</div>

		<div class="description detailed hidden">
			
<p>Add Data to Zip</p>

<p>Lets you add files to the archive. If the path is included in the filename it
will be placed within a directory. Make sure you use add_dir() first to create
the folder.</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$filepath</var></dt>
					<dd><code>mixed</code></dd>
					<dt><var>$data</var></dt>
					<dd><code>string</code></dd>
				</dl></div>





		</div>
		</div></td>
	</tr>
	<tr data-order="_add_data" id="__add_data">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#__add_data">#</a>
		<code><a href="source-class-CI_Zip.html#182-232" title="Go to source code">_add_data</a>( <span>string <var>$filepath</var></span>, <span>string <var>$data</var></span>, <span>mixed <var>$file_mtime</var></span>, <span>mixed <var>$file_mdate</var></span> )</code>

		<div class="description short">
			
<p>Add Data to Zip</p>

		</div>

		<div class="description detailed hidden">
			
<p>Add Data to Zip</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$filepath</var></dt>
					<dd><code>string</code><br>the file name/path</dd>
					<dt><var>$data</var></dt>
					<dd><code>string</code><br>the data to be encoded</dd>
					<dt><var>$file_mtime</var></dt>
					<dd></dd>
					<dt><var>$file_mdate</var></dt>
					<dd></dd>
				</dl></div>





		</div>
		</div></td>
	</tr>
	<tr data-order="read_file" id="_read_file">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_read_file">#</a>
		<code><a href="source-class-CI_Zip.html#236-262" title="Go to source code">read_file</a>( <span>mixed <var>$path</var></span>, <span>mixed <var>$preserve_filepath</var> = <span class="php-keyword1">FALSE</span></span> )</code>

		<div class="description short">
			
<p>Read the contents of a file and add it to the zip</p>

		</div>

		<div class="description detailed hidden">
			
<p>Read the contents of a file and add it to the zip</p>




				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="read_dir" id="_read_dir">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_read_dir">#</a>
		<code><a href="source-class-CI_Zip.html#266-318" title="Go to source code">read_dir</a>( <span>string <var>$path</var></span>, <span>mixed <var>$preserve_filepath</var> = <span class="php-keyword1">TRUE</span></span>, <span>mixed <var>$root_path</var> = <span class="php-keyword1">NULL</span></span> )</code>

		<div class="description short">
			
<p>Read a directory and add it to the zip.</p>

		</div>

		<div class="description detailed hidden">
			
<p>Read a directory and add it to the zip.</p>

<p>This function recursively reads a folder and everything it contains
(including sub-folders) and creates a zip based on it. Whatever directory
structure is in the original file path will be recreated in the zip file.</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$path</var></dt>
					<dd><code>string</code><br>path to source</dd>
					<dt><var>$preserve_filepath</var></dt>
					<dd></dd>
					<dt><var>$root_path</var></dt>
					<dd></dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="get_zip" id="_get_zip">

		<td class="attributes"><code>
			 public 
			binary
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_get_zip">#</a>
		<code><a href="source-class-CI_Zip.html#322-345" title="Go to source code">get_zip</a>( )</code>

		<div class="description short">
			
<p>Get the Zip file</p>

		</div>

		<div class="description detailed hidden">
			
<p>Get the Zip file</p>




				<h4>Returns</h4>
				<div class="list">
					<code>binary</code><br>string<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="archive" id="_archive">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_archive">#</a>
		<code><a href="source-class-CI_Zip.html#349-371" title="Go to source code">archive</a>( <span>string <var>$filepath</var></span> )</code>

		<div class="description short">
			
<p>Write File to the specified directory</p>

		</div>

		<div class="description detailed hidden">
			
<p>Write File to the specified directory</p>

<p>Lets you write a file</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$filepath</var></dt>
					<dd><code>string</code><br>the file name</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="download" id="_download">

		<td class="attributes"><code>
			 public 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_download">#</a>
		<code><a href="source-class-CI_Zip.html#375-398" title="Go to source code">download</a>( <span>string <var>$filename</var> = <span class="php-quote">'backup.zip'</span></span> )</code>

		<div class="description short">
			
<p>Download</p>

		</div>

		<div class="description detailed hidden">
			
<p>Download</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$filename</var></dt>
					<dd><code>string</code><br>the file name</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="clear_data" id="_clear_data">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_clear_data">#</a>
		<code><a href="source-class-CI_Zip.html#402-418" title="Go to source code">clear_data</a>( )</code>

		<div class="description short">
			
<p>Initialize Data</p>

		</div>

		<div class="description detailed hidden">
			
<p>Initialize Data</p>

<p>Lets you clear current zip data. Useful if you need to create multiple zips
with different data.</p>








		</div>
		</div></td>
	</tr>
	</table>












	<table class="summary" id="properties">
	<caption>Properties summary</caption>
	<tr data-order="zipdata" id="$zipdata">
		<td class="attributes"><code>
			public  
			string
		</code></td>

		<td class="name">
				<a href="source-class-CI_Zip.html#35" title="Go to source code"><var>$zipdata</var></a>
		</td>
		<td class="value"><code><span class="php-quote">''</span></code></td>
		<td class="description"><div>
			<a href="#$zipdata" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="directory" id="$directory">
		<td class="attributes"><code>
			public  
			string
		</code></td>

		<td class="name">
				<a href="source-class-CI_Zip.html#36" title="Go to source code"><var>$directory</var></a>
		</td>
		<td class="value"><code><span class="php-quote">''</span></code></td>
		<td class="description"><div>
			<a href="#$directory" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="entries" id="$entries">
		<td class="attributes"><code>
			public  
			integer
		</code></td>

		<td class="name">
				<a href="source-class-CI_Zip.html#37" title="Go to source code"><var>$entries</var></a>
		</td>
		<td class="value"><code><span class="php-num">0</span></code></td>
		<td class="description"><div>
			<a href="#$entries" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="file_num" id="$file_num">
		<td class="attributes"><code>
			public  
			integer
		</code></td>

		<td class="name">
				<a href="source-class-CI_Zip.html#38" title="Go to source code"><var>$file_num</var></a>
		</td>
		<td class="value"><code><span class="php-num">0</span></code></td>
		<td class="description"><div>
			<a href="#$file_num" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="offset" id="$offset">
		<td class="attributes"><code>
			public  
			integer
		</code></td>

		<td class="name">
				<a href="source-class-CI_Zip.html#39" title="Go to source code"><var>$offset</var></a>
		</td>
		<td class="value"><code><span class="php-num">0</span></code></td>
		<td class="description"><div>
			<a href="#$offset" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="now" id="$now">
		<td class="attributes"><code>
			public  
			mixed
		</code></td>

		<td class="name">
				<a href="source-class-CI_Zip.html#40" title="Go to source code"><var>$now</var></a>
		</td>
		<td class="value"><code></code></td>
		<td class="description"><div>
			<a href="#$now" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	</table>






</div>

	<div id="footer">
		tis API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
	</div>
</div>
</div>
</body>
</html>
